import re
from curl_cffi import requests

from util.getheaders import get_init_headers

# url = 'https://www.cloudflare.com/cdn-cgi/trace'
# res = requests.get(url)
# print(res.text)

# import requests
# url = 'https://www.cloudflare.com/cdn-cgi/trace'
# res = requests.get(url)
# print(res.text)

url = 'https://tieba.baidu.com/t/f/?class=college'


res = requests.get(url,headers=get_init_headers(),impersonate=requests.BrowserType.chrome100)
print(res.text)
items = re.findall(r'<a class="each_topic_entrance_item" href="(.*?)" data-fid="(.*?)">(.*?)</a>', res.text, re.S)
for item in items:
    print(item)




